Motivation

The 2016 General Election for President of the United States was our very first general election in which we were able to vote. Many pundits, politicians, and citizens alike found the contest between Hillary Clinton and Donald Trump to be one of the most bitter presidential races in recent memory, and many more were surprised by the outcome.

Most pollsters and statisticians had Hillary Clinton maintaining a comfortable margin before the election. Yet, Donald Trump emerged victorious as the 45th President of the United States. Our goal is to try to explain why.

We have incorporated US Census demographic data, as well as employing comparisons between Donald Trump’s 2016 victory with Barack Obama’s 2012 re-election against Mitt Romney.

What You Will Find Below

Below are primarily the visualizations generated from our analysis. They were created via leaflet and ggplot2. Our 2012 election data was obtained from the Huffington Post, and our 2016 election data was sourced from Kaggle.

Code for the graphics is not included in chunks below. Please consult our Github for more information.

Our analysis excludes Alaska and Hawaii.


2016 Election

Margin of Victory

Let’s take a look at the 2016 electoral map, divided by county.

Gradient Map

The gradient within the map represents the margin of victory, from 60% or greater margin of victory for Trump in red to 60% or more margin of victory for Clinton in blue.

Naturally, Clinton has a visible edge in more urban, coastal areas while Trump has an advantage in more rural areas.


Pure Win-Loss

We can clarify the win by county by removing the gradient.


Interactive

Let’s check out a few interactive maps created with leaflet.

Virginia

Pennsylvania

United States


2012 Election

Margin of Victory


Pure Win-Loss

Like the procedure above, we can remove the gradient and look at the winner by county.

It is certainly quite evident that Obama was able to win a significantly greater number of counties in 2012 compared to Clinton in 2016. We will run through some exact comparisons below.


2012 and 2016 Comparisons

Map Comparisons

Let’s compare the win-loss maps by county from 2012 to 2016.

2012

2016


2016 Flipped Counties

How successful were each of the candidates in flipping counties from their previous victor? Below is a graph of the 2016 electoral map, with flips highlighted in yellow for Trump (Trump winning a county won by Obama in 2012) and green for Clinton (Clinton winning a county won by Romney in 2012).

We can clean up the colors by marking the unchanged counties in grey and re-marking the flipped counties for clarity.

Table of Flipped Counties by State

We can further drill down and take a look at the geographic breakdown of flipped counties by state.

Trump
Clinton

As evidenced from the tables above, Trump was much more successful than Clinton in flipping counties from 2012 to 2016.


Interactive

Given the information from above, it looks as if Clinton lost significant numbers of counties in the Northeast and Midwest that were once held by Obama. Let’s explore in greater detail

Northeast

Midwest

Voter Turnout Comparisons

Given the voting information for 2012 and 2016, we can also construct a representation of voter turnout from 2012 to 2016. As a side note, the very large decrease was from Los Angeles County for both parties.

2012-2016, Total Turnout

2012-2016, Republican Party Turnout

We can compare the 2012 and 2016 turnouts for just the Republican Party.

2012-2016, Democratic Party Turnout


Hypotheticals

Even though we understand that the circumstances surrounding both the 2012 and 2016 elections were different, how well could Obama have performed in the 2016 election had he gone against Trump and maintained the same performance that he did in 2012?

Interactive

Northeast

Midwest

Head-to-Head Hypothetical Matchup

Here’s what the US county electoral map would have looked like if we matched Obama’s 2012 performance to Trump’s 2016 victory.